package net.crowdloud.server.DatabaseAccess.groups;

import javax.jdo.PersistenceManager;

import com.google.appengine.api.datastore.Text;

public class SaveGroups {

	public static void addNew(PersistenceManager persistenceManager,
			net.crowdloud.shared.entities.Groups groups) {

		Groups groupsDatabase = new Groups();

		groupsDatabase.setGroupsList(new Text(groups.getGroups()));

		persistenceManager.makePersistent(groupsDatabase);

	}

	public static void update(PersistenceManager persistenceManager,
			net.crowdloud.shared.entities.Groups groups) {

		Groups groupsDatabase = GetGroups.get(persistenceManager);

		groupsDatabase.setGroupsList(new Text(groups.getGroups()));

		persistenceManager.makePersistent(groupsDatabase);
	}

}